import React from 'react'
import styles from './ProblemList.css'
type Props = {
  title: String,
  data: Array
}
class ProblemList extends React.Component {
  props: Props
  render () {
    const { data } = this.props
    return (
      <div className={styles['main']}>
        <h3>{this.props.title}</h3>
        <ul>
          {
            Object.keys(data).map((key, i) => {
              return <label key={i}>
                <li className={styles['bg']}>
                  {key}:
                </li>
                <li title={data[key]}>
                  {data[key]}
                </li>
              </label>
            })
          }
        </ul>
      </div>
    )
  }
}
export default ProblemList
